<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html">
		<title>MServer</title>
		<link href="styles.css" rel="stylesheet" type="text/css">
		<link href="styles_class.css" rel="stylesheet" type="text/css">
	</head>

	<body>
		<div id="container">
			<div id="header"><span>
				<p><a href="http://mjs.darkgreenmedia.com">mjs.darkgreenmedia.com</a></p>
				<p><a href="index.html">back</a></p>
				</span>
			</div>

		<div class="block1">
			<div class="title"><h2>Name</h2></div>
			<div class="block2"><p class="name">MServer</p></div>
		</div>

		<div class="block1">
			<div class="title"><h2>Examples</h2></div>
			<div class="block2">
				<div class="sample">
					<pre>
import mjs.processing.mobile.mbluetooth.*;
import mjs.processing.mobile.mclientserver.*;

MServer server;

int val = 0;

void setup()
{
	server = MBluetooth.startService(0x1234567890L);
}

void draw()
{
	val = (val + 1) % 255;
	background(val);

	if(server != null)
		server.write(val);
}
					</pre>
    				<br/>
	  			</div>
			</div>
		</div>
  
  
		<div class="block1">
			<div class="title"><h2>Description</h2></div>
			<div class="block2">
				A server sends and receives data to and from its associated clients (other programs connected 
				to it). When a server is started, it begins to listening for connections on the specified address.
				The server is created by the service that provides client server communication, for example bluetooth. 
			</div>
		</div>


		<div class="block1">
			<div class="title"><h2>Methods</h2></div>
			<div class="block2">
				<ul>
		  			<li><a href="MServer_write.html">write()</a></li>
					<div class="description2">Write data to all connected clients</div>
		  			<li><a href="MServer_available.html">available()</a></li>
					<div class="description2">Returns the next client in line with a new message</div>
		  			<li><a href="MServer_stop.html">stop()</a></li>
					<div class="description2">Disconnect all clients and stops the server</div>
		  			<li><a href="MServer_disconnect.html">disconnect()</a></li>
					<div class="description2">Disconnect a particular client</div>
				</ul>
			</div>
		</div>
	</div>		
	</body>
</html>
